using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Helper
{
    private static int uniqueId = 0;
    public static int GetUniqueId()
    {
        uniqueId++;
        if (uniqueId >= 1000000000) {
            uniqueId = 0;
        }
        return uniqueId;
    }


    /*** 根据秒数返回 1天00:00:00 的时钟格式 ***/
    public static string GetDHMSFormatCD(int second)
    {
        var day = second / (3600 * 24) >> 0;
        var h = second % (3600 * 24) / 3600 >> 0;
        var m = second % 3600 / 60 >> 0;
        var s = second % 3600 % 60;

        var strH = h < 10 ? "0" + h : h + "";
        var strM = m < 10 ? "0" + m : m + "";
        var strS = s < 10 ? "0" + s : s + "";

        if (day == 0)
        {
            if (h == 0)
            {
                return $"{strM}:{strS}";
            }
            else
            {
                return $"{strH}:{strM}:{strS}";
            }
        }
        return $"{day}天{strH}:{strM}:{strS}";
    }

    public static string GetMSFormatCD(int second)
    {
        var m = second % 3600 / 60 >> 0;
        var s = second % 3600 % 60;

        var strM = m + "";
        var strS = s < 10 ? "0" + s : s + "";

        return $"{strM}:{strS}";
    }



}
